#ifndef MENU_HH_
# define MENU_HH_

# include "Option.hh"

// probably use callback to change OpenGL context (chage_resolution option)
// cd use class / function pointers
// => option shd be a class, not a struct

class Menu
{
public:
  /** Ctor; type is used to switch between various menu types:
   ** type must match one of those values:
   **   {MENU_TITLE, MENU_PAUSE, MENU_BLACKMARKET}
   ** this Ctor also fill _optList according to type
   */
  Menu(unsigned char type);

  ~Menu();

  bool execOption(Option opt);

  // __________ display methods

  // shd add an animation to display menu (goldeneye watch style)
  /// draw the menu
  void invokeMenu();

  /** switch to the next option
   ** pull clip (play animation)
   ** update tooltip
   ** called on mouse wheel down event
   */
  void nextOption();

  /** switch to the next option
   ** engage clip (play animation)
   ** update tooltip
   ** called on mouse wheel up event
   */
  void prevOption();

  /** play switch gun animation
   */
  void nextMenuSection();

  /// draw (annimated ?) background
  void DrawBackground();

  /** calls DrawOption in loop
   **/
  void DrawOptionList();

  /// navigate through option lists
  void switchOptionList();


  /** draw one (and only one option)
   ** \param index: number of previously displayed options
   **   => usefull to calc coords
   */
  void drawOption(Option opt, unsigned char index);

private:
  int _type; /// which menu is it ?
  int _nbOpt; /// number of options in this menu
  bool _exitMenu; /// user quit menu request (cd be 2 start a game)

  // useless ? MMO
  // bool _pause; /// does this menu requests a pause

  Sound _sound; /// played sound while in menu

  Vector2 _mouseCoords;
  Vector2 _windowSize;
  std::List<std::List<Option>> _optList; /// Option list vector
};

#endif /* !MENU_HH_ */
